using GammaJul.ReSharper.GammaXaml.Highlightings.Xaml;
using GammaJul.ReSharper.GammaXaml.Psi.Xaml;
using JetBrains.Annotations;
using JetBrains.ProjectModel;
using JetBrains.ReSharper.Daemon;
using JetBrains.ReSharper.Psi.Xaml.Impl.Tree;

[assembly: RegisterConfigurableSeverity(
	RedundantDefaultGridDefinitionCollectionSetterHighlighting.SeverityId,
	null,
	HighlightingGroupIds.CodeRedundancy,
	RedundantDefaultGridDefinitionCollectionSetterHighlighting.Description,
	RedundantDefaultGridDefinitionCollectionSetterHighlighting.Description,
	Severity.SUGGESTION,
	false)]

namespace GammaJul.ReSharper.GammaXaml.Highlightings.Xaml {

	/// <summary>
	/// An highlighting that indicates that an empty collection setter is redundant.
	/// </summary>
	[ConfigurableSeverityHighlighting(SeverityId, XamlProjectFileType.Name, AttributeId = HighlightingAttributeIds.DEADCODE_ATTRIBUTE, OverlapResolve = OverlapResolveKind.DEADCODE)]
	public class RedundantDefaultGridDefinitionCollectionSetterHighlighting : DeadCodeSetterHighlightingBase {
		internal const string SeverityId = "Xaml.RedundantDefaultGridDefinitionCollectionSetter";
		internal const string Description = "A Grid.RowDefinitions/ColumnsDefinitions collection setter with a single star-sized definition is the same as the Grid defaults.";

		private readonly GridDefinitionType _definitionType;

		public GridDefinitionType DefinitionType {
			get { return _definitionType; }
		}

		public override string ToolTip {
			get { return _definitionType.ToString() + "Definitions with a single star-sized definition is the same as the Grid defaults."; }
		}
		
		public RedundantDefaultGridDefinitionCollectionSetterHighlighting([NotNull] IPropertySetter propertySetter, GridDefinitionType definitionType)
			: base(propertySetter) {
			_definitionType = definitionType;
		}
	}

}
